*headdesk* Apparently QTextLayout::FormatRange() does not have an initializing ctor...
[quassel.git] / src / uisupport / uistyle.cpp
index 79f23c6..5f0f717 100644 (file)
@@ -26,6 +26,7 @@ UiStyle::UiStyle(const QString &settingsKey) : _settingsKey(settingsKey) {
   QTextCharFormat def;
   def.setForeground(QBrush("#000000"));
   //def.setFont(QFont("Courier", 10));
+  def.font().setFixedPitch(true);
   def.font().setStyleHint(QFont::TypeWriter);
   _defaultFormats = QVector<QTextCharFormat>(NumFormatTypes, def);
   _customFormats = QVector<QTextCharFormat>(NumFormatTypes, QTextFormat().toCharFormat());
@@ -130,9 +131,7 @@ QString UiStyle::formatCode(FormatType ftype) const {
 }
 
 UiStyle::StyledText UiStyle::styleString(const QString &_s) {
-  QString s = _s;  // we can't use call-by-value since this seems to maybe screw up Qt's implicit sharing somehow
-                   // at least invalid formats are created if we do that
-  if(s.startsWith(" ")) {};  // and yet some other stupid no-op that seems to fix the font issue on some machines... -_- 
+  QString s = _s;
   StyledText result;
   QList<FormatType> fmtList;
   fmtList.append(None);
@@ -240,5 +239,3 @@ QTextCharFormat UiStyle::mergedFormat(QList<FormatType> formatList) {
   }
   return fmt;
 }
-
-