Making only one column of a QTreeWidgetItem editable

You can make only certain columns in a QTreeWidget editable using a workaround: 1) Set the editTriggers property of the QTreeWidget to NoEditTriggers 2) On inserting items, set the Qt:ItemIsEditable flag of the QTreeWidgetItem object 3) Connect the following slot to the “itemDoubleClicked” signal of the QTreeWidget object: void MainWindow::onTreeWidgetItemDoubleClicked(QTreeWidgetItem * item, int column) { … Read more

about assembly CF(Carry) and OF(Overflow) flag

The distinction is in what instructions are used to manipulate the data, not the data itself. Modern computers (since circa 1970) use a representation of integer data called two’s-complement in which addition and subtraction work exactly the same on both signed and unsigned numbers. The difference in representation is the interpretation given to the most … Read more

What are the gcc predefined macros for the compiler’s version number?

From the gnu cpp manual… __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ These macros are defined by all GNU compilers that use the C preprocessor: C, C++, Objective-C and Fortran. Their values are the major version, minor version, and patch level of the compiler, as integer constants. For example, GCC 3.2.1 will define __GNUC__ to 3, __GNUC_MINOR__ to 2, … Read more

Flags in a database rows, best practices

Generally speaking, I avoid bitmask fields. They’re difficult to read in the future and they require a much more in-depth knowledge of the data to understanding. The relational solution has been proposed previously. Given the example you outlined, I would create something like this (in SQL Server): CREATE TABLE Users ( UserId INT IDENTITY(1, 1) … Read more